﻿<!doctype html>
<html>
	<!-- InstanceBegin template="/Templates/template1.dwt" codeOutsideHTMLIsLocked="false" -->
	<head>
		<meta charset="utf-8">
		<!-- InstanceBeginEditable name="doctitle" -->
		<title>产品信息修改</title>
		<!-- InstanceEndEditable -->

		<script type="text/javascript" src="../js/common.js"></script>
		<script type="text/javascript" src="../js/checkLogin.js"></script>
		<link href="../css/Pager.css" type="text/css" rel="stylesheet" />
		<script type="text/javascript" src="../js/jquery.pager.js"></script>
		<script type="text/javascript" src="../js/gbRst.js"></script>
		<script type="text/javascript" src="../js/doubleDate2.0.js"></script>
		<script type="text/javascript" src="../js/utils.js"></script>
		<script type="text/javascript" src="../js/find.js"></script>
		<script type="text/javascript" src="../js/ajaxfileupload.js"></script>
		<script type="text/javascript" src="../js/ImageBrowsing.js"></script>
		<script charset="utf-8" src="../js/kindeditor.js"></script>
		<script type="text/javascript" src="../js/formValidator.js"></script>
		<script type="text/javascript" src="../js/formValidatorRegex.js"></script>
		<script charset="utf-8" src="../js/lang/zh_CN.js"></script>
		<script charset="utf-8" src="../js/editor.js"></script>
		<link href="../css/validator3.css" type="text/css" rel="stylesheet" />
		<link href="../css/style.css" type="text/css" rel="stylesheet" />
		<script type="text/javascript">
			var shopPageIndex = 0;
			var shopCount = 0;
			var _goodsLargeTypeId = 0;
			var _goodsMedTypeId = 0;
			var _goodsSmlTypeId = 0;
			var _goodsTypePageIndex = 1;
			var _goodsTypePageCount = 0;
			var _typeFlag = 0;
			var htmlStr = null;
			var _goodsId = 0;

			$(function() {
				refreshInput($(".serWrapper"));
				$(".hideDiv").each(function() {
					addMargin($(this));
				});
				$('.doubledate').kuiDate({
					className : 'doubledate',
					isDisabled : "1" // isDisabled为可选参数，“0”表示今日之前不可选，“1”标志今日之前可选
				});
				browse('upload', 'imgSrc', 100, 100);
				_goodsId = getIdByName("id");
				getGoodsById();
			});

			function getGoodsById() {
				if (_goodsId == 0) {
					art.dialog({
						fixed : true,
						lock : true,
						content : "页面出错",
						icon : 'error',
						ok : true
					});
					return false;
				} else {
					$.ajax({
						type : "get",
						async : false,
						datatype : "json",
						url : "../goods/find/id/" + _goodsId,
						success : function(data) {
							var rst = JSON.parse(data);
							if (IsEmpty(rst)) {
								art.dialog({
									fixed : true,
									lock : true,
									content : "查询出错",
									icon : 'error',
									ok : true
								});
								return false;
							}
							if (rst.state == 0) {
								if (rst.result.len == 0) {
									art.dialog({
										fixed : true,
										lock : true,
										content : "该产品id不存在",
										icon : 'error',
										ok : true
									});
									return false;
								} else {
									resetForm(rst);
								}
							} else if (rst.state == 1) {
								art.dialog({
									fixed : true,
									lock : true,
									content : rst.msg,
									icon : 'error',
									ok : true
								});
							} else {
								checkStateShowErrorMsgAndDealResult(data);
							}
						}
					});
				}
			}

			/**
			 * 加载商铺列表数据
			 */
			function InitShopList(shopPageIndex) {
				$.ajax({
					type : "get",
					async : false,
					datatype : "json",
					url : "../supplier/find/supplierList/" + shopPageIndex + "/5",
					success : function(data) {
						var rst = JSON.parse(data);
						if (IsEmpty(rst)) {
							art.dialog({
								fixed : true,
								lock : true,
								content : "查询出错",
								icon : 'error',
								ok : true
							});
							return false;
						}
						if (rst.state == 0) {
							$("#shopList tbody tr").remove();

							initShopTable(rst);
							$("table[id='shopList'] tbody tr").each(function() {
								$(this).children("td:last").css("text-align", "center").html("<input type='button' class='common_btn' value='选择' onclick='bclicks($(this))'>");

							})
							if (rst.result.len > 0) {
								var shu = rst.result.len;
								shopCount = Math.ceil(shu / 5);
							} else {
								shopCount == 0;
							}
							$("#shopPager").pager({
								pagenumber : ++shopPageIndex,
								pagecount : shopCount,
								buttonClickCallback : ShopPageClick
							});
							addMargin($("#shopShow"));
						} else if (rst.state == 1) {
							art.dialog({
								fixed : true,
								lock : true,
								content : rst.msg,
								icon : 'error',
								ok : true
							});
						} else {
							checkStateShowErrorMsgAndDealResult(data);
						}
					}
				});
			}

			/**
			 * 加载 商铺列表，拷贝
			 */
			function initShopTable(json) {
				if (json != null && json.state == 0) {
					var params = new Array("id", "name", "contact");
					_loadInfo(json, "shopList", params);
					//LoadShoptable(json,params,"shopList");
				}
			}

			/**
			 * 加载 商铺列表，拷贝
			 */
			function LoadShoptable(json, params, tableId) {
				var phArray = new Array();
				var count = 0;
				if (params != null) {
					$(params).each(function(pIndex, pData) {
						$.each(json.result.head, function(hIndex, hData) {
							if (pData == hData) {
								phArray[count++] = hIndex;
							}
						});
					});
				}
				if (json.result.data != null) {
					$.each(json.result.data, function(index, dt) {
						$("table[id='" + tableId + "']").append("<tr></tr>");
						$(phArray).each(function(phIndex, data) {
							$.each($(dt), function(dtIndex, d) {
								if (dtIndex == data) {
									$("table[id='" + tableId + "'] tr:last").append("<td>" + (d === null || d == "null" ? " " : d) + "</td>");
								}
							});
						});
					});
				}
			}

			/**
			 * 商铺分页
			 */
			function PageClick(pageclickednumber) {
				_pageIndex = pageclickednumber;
				InitTable();
			}

			/**
			 * 商铺列表分页
			 */
			function ShopPageClick(pageclickednumber) {
				$("#shopPager").pager({
					pagenumber : --pageclickednumber,
					pagecount : pagecount,
					buttonClickCallback : PageClick
				});
				$("#result").html("Clicked Page " + pageclickednumber);
				InitShopList(pageclickednumber);
			}

			/**
			 * 商铺分页，拷贝
			 */
			function bclicks(obj) {
				var $first = obj.parent("td").parent("tr").children("td:first");
				var id = $first.html();
				var name = $first.next().html();
				//$("#shopName").children("option").blur();
				getParamToshopS(id, name)
			}

			/**
			 * 商铺分页，拷贝
			 */
			function getParamToshopS(id, name) {
				var shopflag = $("#shopflag").val();
				if (shopflag == 0) {

					$("#shopName").html("");
					$("#shopName").html(htm);
					$("#shopName").val(id);
				} else {
					$("#shopName2").html("");
					$("#shopName2").val(name);
					$("#shopId").val(id);
				}
				closeShopShow();
			}

			/**
			 * 商铺分页，拷贝
			 */
			function closeShopShow() {
				$("#shopShow,#yinying").hide();
				$("#searchName").val("")
			}

			function resetForm(rst) {
				$("#shopName2").val(getHtmlString(getHeadIndexValue(0, rst, "supName")));
				$("#shopId").val(getHtmlString(getHeadIndexValue(0, rst, "supId")));
				$("#name").val(getHtmlString(getHeadIndexValue(0, rst, "name")));
				$("#imgSrc img").attr("src", getHtmlString(getHeadIndexValue(0, rst, "ImageUrl")));
				$("#imageUrl").val(getHtmlString(getHeadIndexValue(0, rst, "ImageUrl")));
				$("#code").val(getHtmlString(getHeadIndexValue(0, rst, "code")));
				$("#srhCode").val(getHtmlString(getHeadIndexValue(0, rst, "srhCode")));
				$("#mode").val(getHtmlString(getHeadIndexValue(0, rst, "mode")));
				$("#barCode").val(getHtmlString(getHeadIndexValue(0, rst, "barCode")));
				$("#attr").val(getHtmlString(getHeadIndexValue(0, rst, "attr")));
				$("#origin").val(getHtmlString(getHeadIndexValue(0, rst, "origin")));
				$("#enableTime").val(getHtmlString(getHeadIndexValue(0, rst, "enableTime")).substring(0, 10));
				$("#disableTime").val(getHtmlString(getHeadIndexValue(0, rst, "disableTime")).substring(0, 10));
				$("#SalePrice").val(getHtmlString(getHeadIndexValue(0, rst, "SalePrice")));
				$("#saleIntegral").val(getHtmlString(getHeadIndexValue(0, rst, "saleIntegral")));
				$("#actLargeType").val(getHtmlString(getHeadIndexValue(0, rst, "LrgName")));
				$("#actSmallType").val(getHtmlString(getHeadIndexValue(0, rst, "MedName")));
				$("#actMiddleType").val(getHtmlString(getHeadIndexValue(0, rst, "SmlName")));
				$("#unit").val(getHtmlInt(getHeadIndexValue(0, rst, "unit")));
				$("#status").val(getHtmlInt(getHeadIndexValue(0, rst, "status")));
				$("#isWx").val(getHtmlInt(getHeadIndexValue(0, rst, "isWx") == "是") ? 1 : 0)
				_goodsLargeTypeId = (getHeadIndexValue(0, rst, "LrgId"))
				_goodsMedTypeId = (getHeadIndexValue(0, rst, "MedId"))
				_goodsSmlTypeId = (getHeadIndexValue(0, rst, "SmlId"))
				$("#save_btn").show();
				$("#validYear").val(getHtmlInt(getHeadIndexValue(0, rst, "validYear")));
				$("#validMonth").val(getHtmlInt(getHeadIndexValue(0, rst, "validMonth")));
				$("#validDay").val(getHtmlInt(getHeadIndexValue(0, rst, "validDay")));
				$("#workingTime").val(getHtmlInt(getHeadIndexValue(0, rst, "workingTime")));

				$("#memo").val(getHtmlString(getHeadIndexValue(0, rst, "memo")))
				$("#indexUrl").val(getHtmlString(getHeadIndexValue(0, rst, "indexUrl")))

				getHtmlByUrl(getHtmlString(getHeadIndexValue(0, rst, "indexUrl")))
				$("#costPrice").val(getHtmlString(getHeadIndexValue(0, rst, "costPrice")))
				$("#priceStr").val(getHtmlString(getHeadIndexValue(0, rst, "priceStr")))
				$(".isDisabled").attr("disabled", false)
				browse('upload', 'imgSrc', 96, 96);

			}

			function returnURL() {
				window.location.href = 'products.html?flag=1' + "&menu=" + getIdByName("menu") + "&submenu=" + getIdByName("submenu");
			}

			function showShopList(flag) {
				$("#shopflag").val(flag);
				if (flag == 0) {

					$("#shopIsChoosed").attr("checked", "checked");
					$("#shopName").blur();
				} else {
					$("#shopName2").blur();

				}
				$("#shopShow,#yinying").show();
				addMargin($("#shopShow"));
				InitShopList(0);
			}

			/**
			 * 关闭 添加或更新面板
			 */
			function closeShopShow() {
				$("#shopShow,#yinying").hide();
				$("#searchName").val("")
			}

			function toSave() {

				var shopId = $("#shopId").val();
				var name = $("#name").val();
				var code = $("#code").val();
				var srhCode = $("#srhCode").val();
				var mode = $("#mode").val();
				var barCode = $("#barCode").val();
				var attr = $("#attr").val();
				var unit = $("#unit").val();
				var origin = $("#origin").val();
				var enableTime = $("#enableTime").val();
				var disableTime = $("#disableTime").val();
				var SalePrice = $("#SalePrice").val();
				var saleIntegral = $("#saleIntegral").val();
				var memo = $("#memo").val();
				var status = $("#status").val();
				var isWx = $("#isWx").val();
				var costPrice = $("#costPrice").val()
				var priceStr = $("#priceStr").val()

				if (!checkNull(shopId, "供应商", null) || !checkNull(name, "产品名称", "name") || !checkNull(code, "产品编码", "code") || !checkNull(srhCode, "产品检索码", "srhCode") || !checkNull(barCode, "产品条码", "barCode")) {
					return false
				}
				if (!checkNull(mode, "产品规格", "mode") || !checkNull(enableTime, "产品启用日期", null) || !checkNull(disableTime, "产品禁用日期", null) || !_checkMoney(costPrice, false, "产品原价", "costPrice") || !_checkMoney(SalePrice, false, "产品零售价", "SalePrice") || !checkNull(barCode, "产品条码", "barCode")) {
					return false
				}
				if (_goodsLargeTypeId == 0) {
					art.dialog({
						fixed : true,
						lock : true,
						content : "请选择商品大类",
						icon : 'error',
						ok : true
					});
					return false;
				}

				var validYear = getInputValue("validYear");
				var validMonth = getInputValue("validMonth");
				var validDay = getInputValue("validDay");
				if (IsEmpty(validYear) && IsEmpty(validMonth) && IsEmpty(validDay)) {
					/*
					 artError("保养周期不能为空");
					 return false */
				} else {
					if (!checkNumber(validYear, true, "保养时间格式错误", "validYear") || !checkNumber(validMonth, true, "保养时间格式错误", "validMonth") || !checkNumber(validDay, true, "保养时间格式错误", "validDay")) {
						return false;
					} else {
						if (validYear == 0 && validMonth == 0 && validDay == 0) {
							/* artError("请填写保养周期");
							 return false; */
						}
					}
				}
				var workingTime = getInputValue("workingTime")
				if (IsEmpty(workingTime)) {
					/* artError("保养时间不能为空");
					 return false */
				} else {
					if (!checkMoney(workingTime)) {
						/* artError("施工时间格式时间错误");
						 return false; */
					} else {
						if (workingTime == 0) {
							/* artError("请填写施工时间");
							 return false; */
						}
					}
				}

				var heads = new Array("SmlId", "MedId", "LrgId", "supId", "code", "name", "srhCode", "barCode", "mode", "unit", "origin", "enableTime", "disableTime", "attr", "memo", "status", "isWx", "validYear", "validMonth", "validDay", "workingTime", "priceStr", "id");
				var datas = new Array(_goodsSmlTypeId, _goodsMedTypeId, _goodsLargeTypeId, shopId, code, name, srhCode, barCode, mode, unit, origin, enableTime, disableTime, attr, memo, status, isWx, validYear, validMonth, validDay, workingTime, priceStr, _goodsId);

				var parser = new Object();
				var jsonParserStr = null;
				if (IsNotEmpty(datas)) {
					addToParser(heads, datas, "edit", parser);
					jsonParserStr = JSON.stringify(parser);
				}

				var heads2 = new Array("SalePrice", "saleIntegral", "costPrice", "id");
				var datas2 = new Array(SalePrice, saleIntegral, costPrice, _goodsId);
				var parser2 = new Object();
				var jsonParserStr2 = null;
				if (IsNotEmpty(datas2)) {
					addToParser(heads2, datas2, "edit", parser2);
					jsonParserStr2 = JSON.stringify(parser2);
				}

				$("#save_btn").attr("disabled", true)
				$.post("../goods/edit/editInfo", {
					"data" : jsonParserStr,
					"pData" : jsonParserStr2,
					"htmlStr" : editorHtml
				}, function(data) {
					$("#save_btn").attr("disabled", false)
					var dt = JSON.parse(data);

					if (IsEmpty(dt)) {
						art.dialog({
							fixed : true,
							lock : true,
							content : "修改出错",
							icon : 'error',
							ok : true
						});
						return false;
					}
					if (dt.state == 0) {
						if (IsNotEmpty($("#upload").val())) {
							uploadImage();
						} else {
							art.dialog({
								fixed : true,
								lock : true,
								content : "修改成功",
								icon : 'succeed',
								ok : true
							});
						}
					} else if (dt.state == 1) {
						art.dialog({
							fixed : true,
							lock : true,
							content : dt.msg,
							icon : 'error',
							ok : true
						});
					} else {
						checkStateShowErrorMsgAndDealResult(data);
					}

				});

			}

			function uploadImage(id) {

				$.ajaxFileUpload({
					url : "../goods/upload/images/" + _goodsId,
					secureuri : false,
					fileElementId : 'upload',
					dataType : 'json',
					success : function(data) {
						if (data.state == 0) {
							art.dialog({
								fixed : true,
								lock : true,
								content : "修改成功",
								icon : 'succeed',
								ok : true
							});
						} else if (data.state == 1) {
							art.dialog({
								fixed : true,
								lock : true,
								content : "图片上传失败",
								icon : 'error',
								ok : true
							});
						}
					},
					error : function(data) {
						art.dialog({
							fixed : true,
							lock : true,
							content : "图片上传失败",
							icon : 'error',
							ok : true
						});
						return false;
					}
				});

				browse('imgURL', 'imgSrc', 75, 51)
			}

			function showGoodsType(objId, typeFlag) {
				_typeFlag = typeFlag;
				_goodsTypePageIndex = 1;
				if (typeFlag == 1) {
					$("#" + objId + " table caption").html("产品大类");
					getGoodsLarType();
				} else if (typeFlag == 2) {
					$("#" + objId + " table caption").html("产品中类");
					getGoodsMedType();
				} else if (typeFlag == 3) {
					$("#" + objId + " table caption").html("产品小类");
					getGoodsSmlType();
				}
			}

			function showHideDiv(objId) {

				$("#" + objId).show();
				$("#yinying").show();
			}

			function getGoodsLarType() {
				$.ajax({
					type : "get",
					async : false,
					datatype : "json",
					url : "../goodsTypeLrg/find/goodsTypeLrgList/" + (_goodsTypePageIndex - 1) + "/5",
					success : function(data) {
						var rst = JSON.parse(data);
						if (IsEmpty(rst)) {
							art.dialog({
								fixed : true,
								lock : true,
								content : "查询出错",
								icon : 'error',
								ok : true
							});
							return false;
						}
						if (rst.state == 0) {
							$("#actLargeList tbody tr").remove();

							initGoodsType(rst);

							if (rst.result.len > 0) {
								var shu = rst.result.len;
								_goodsTypePageCount = Math.ceil(shu / 5);
							} else {
								_goodsTypePageCount = 0;
							}
							$("#goodsTypePager").pager({
								pagenumber : _goodsTypePageIndex,
								pagecount : _goodsTypePageCount,
								buttonClickCallback : function(pageclickednumber) {
									_goodsTypePageIndex = pageclickednumber;
									getGoodsLarType()
								}
							});
							addMargin($("#window1"));
						} else if (rst.state == 1) {
							art.dialog({
								fixed : true,
								lock : true,
								content : rst.msg,
								icon : 'error',
								ok : true
							});
						} else {
							checkStateShowErrorMsgAndDealResult(data);
						}
					}
				});
			}

			function getGoodsMedType() {
				if (_goodsLargeTypeId == 0) {
					art.dialog({
						fixed : true,
						lock : true,
						content : "请先选择产品大类",
						icon : 'error',
						ok : true
					});
					return false;
				}
				$.ajax({
					type : "get",
					async : false,
					datatype : "json",
					url : "../goodsTypeMed/find/MedListBylId/" + _goodsLargeTypeId + "/" + (_goodsTypePageIndex - 1) + "/5",
					success : function(data) {
						var rst = JSON.parse(data);
						if (IsEmpty(rst)) {
							art.dialog({
								fixed : true,
								lock : true,
								content : "查询出错",
								icon : 'error',
								ok : true
							});
							return false;
						}
						if (rst.state == 0) {
							$("#actLargeList tbody tr").remove();

							initGoodsType(rst);

							if (rst.result.len > 0) {
								var shu = rst.result.len;
								_goodsTypePageCount = Math.ceil(shu / 5);
							} else {
								_goodsTypePageCount = 0;
							}
							$("#goodsTypePager").pager({
								pagenumber : _goodsTypePageIndex,
								pagecount : _goodsTypePageCount,
								buttonClickCallback : function(pageclickednumber) {
									_goodsTypePageIndex = pageclickednumber;
									getGoodsMedType()
								}
							});
							addMargin($("#window1"));
						} else if (rst.state == 1) {
							art.dialog({
								fixed : true,
								lock : true,
								content : rst.msg,
								icon : 'error',
								ok : true
							});
						} else {
							checkStateShowErrorMsgAndDealResult(data);
						}
					}
				});
			}

			function getGoodsSmlType() {
				if (_goodsMedTypeId == 0) {
					art.dialog({
						fixed : true,
						lock : true,
						content : "请先选择产品中类",
						icon : 'error',
						ok : true
					});
					return false;
				}
				$.ajax({
					type : "get",
					async : false,
					datatype : "json",
					url : "../goodsTypeSml/find/MId/" + _goodsMedTypeId + "/" + (_goodsTypePageIndex - 1) + "/5",
					success : function(data) {
						var rst = JSON.parse(data);
						if (IsEmpty(rst)) {
							art.dialog({
								fixed : true,
								lock : true,
								content : "查询出错",
								icon : 'error',
								ok : true
							});
							return false;
						}
						if (rst.state == 0) {
							$("#actLargeList tbody tr").remove();

							initGoodsType(rst);

							if (rst.result.len > 0) {
								var shu = rst.result.len;
								_goodsTypePageCount = Math.ceil(shu / 5);
							} else {
								_goodsTypePageCount = 0;
							}
							$("#goodsTypePager").pager({
								pagenumber : _goodsTypePageIndex,
								pagecount : _goodsTypePageCount,
								buttonClickCallback : function(pageclickednumber) {
									_goodsTypePageIndex = pageclickednumber;
									getGoodsSmlType()
								}
							});
							addMargin($("#window1"));
						} else if (rst.state == 1) {
							art.dialog({
								fixed : true,
								lock : true,
								content : rst.msg,
								icon : 'error',
								ok : true
							});
						} else {
							checkStateShowErrorMsgAndDealResult(data);
						}
					}
				});
			}

			function initGoodsType(json) {

				for (var i = 0; i < json.result.data.length; i++) {
					$("#actLargeList").append("<tr></tr>")
					var htm = "<td>" + getHtmlString(getHeadIndexValue(i, json, "name")) + "</td>";
					$("#actLargeList tr:last").append(htm)
					$("#actLargeList tr:last").append("<td><input type='button' class='common_btn' value='选择' onclick='chooseGoodType(\"" + getHtmlString(getHeadIndexValue(i, json, "name")) + "\"," + getHtmlString(getHeadIndexValue(i, json, "id")) + ")'></td>");

				}
				showHideDiv("window1")

			}

			function chooseGoodType(name, id) {
				if (_typeFlag == 1) {
					if (_goodsLargeTypeId !== id) {
						_goodsLargeTypeId = id
						$("#actLargeType").val(name)
						_goodsMedTypeId = 0
						$("#actSmallType").val('')
						_goodsSmlTypeId = 0
						$("#actMiddleType").val('')
					}
				} else if (_typeFlag == 2) {
					if (_goodsMedTypeId != id) {
						_goodsMedTypeId = id
						$("#actSmallType").val(name)
						_goodsSmlTypeId = 0
						$("#actMiddleType").val('')
					}
				} else if (_typeFlag == 3) {
					_goodsSmlTypeId = id
					$("#actMiddleType").val(name)
				}
				$("#window1,#yinying").hide();

			}

		</script>

	</head>

	<body>
		<!-- InstanceBeginEditable name="EditRegion3" -->

		<div id="yinying1"></div>
		<div id="yinyingCenter"></div>
		<div id="yinying"></div>

		<!-- 活动大类 -->
		<div class="hideDiv hideOver" id="window1">
			<div class="closeTop">
				<span class="closeThe" onclick="closeParent($(this))"><img src="../images/close.png"></span>
			</div>
			<table id="actLargeList" width="100%" cellspacing="1" cellpadding="0" border="0" class="member_list">
				<caption>
					活动大类
				</caption>
				<thead>
					<tr>
						<th>类别</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>

				</tbody>
			</table>
			<div id = "goodsTypePager" class="shopPager"></div>
		</div>
		<!-- 活动小类 -->
		<div class="hideDiv hideOver" id="window2">
			<div class="closeTop">
				<span class="closeThe" onclick="closeParent($(this))"><img src="../images/close.png"></span>
			</div>
			<table id="actSmallList" width="100%" cellspacing="1" cellpadding="0" border="0" class="member_list">
				<caption>
					活动小类
				</caption>
				<thead>
					<tr>
						<th>类别</th>
						<th>操作</th>
						<th>类别</th>
						<th>操作</th>
						<th>类别</th>
						<th>操作</th>
						<th>类别</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>

				</tbody>
			</table>
		</div>
		<div class="container" id="container">
			<div class="container_R fr">
				<div class="place">
					<a onclick='returnURL()' href='javaScript:void(0)'>产品信息</a><span> &gt; <span>产品信息修改<a class="goHome" onclick='returnURL()' href='javaScript:void(0)'>返回</a>
				</div>
				<div class="member_search publish" id="content" style="padding:0;">
					<input type="hidden" id="doflag" value="0">
					<input type="hidden" id="updateId" >
					<input type="hidden" id="shopflag">
					<form name="fm1" action="#" target="post">
						<p>
							<span>供应商：</span>
							<input type="text"  id="shopName2" readonly class="isDisabled">
							<input type="hidden" id="shopId">
							<input type="button" value="..." class="btn isDisabled" onclick="showShopList(2)" />
						</p>
						<p>
							<span>产品名称：</span>
							<input type="text" id="name" class="isDisabled">
						</p>
						<p>
							<span>产品图片：</span>
							<input type="text" id="imageUrl" class="isDisabled">
							<input type="button"  value="..." class="btn"  />
							<input type="file" class="file isDisabled" name="upload" id="upload" >
							<span id="imgSrc" class="onlyImgSrc"> <img  src="../images/img_activities1.jpg"> </span>
						</p>
						<p>
							<label><span>产品编码：</span>
								<input type="text" id="code" class="isDisabled">
							</label>
							<label><span>产品检索码：</span>
								<input type="text" id="srhCode" class="isDisabled">
							</label>
						<p>
							<label><span>规格型号：</span>
								<input type="text" id="mode" class="isDisabled">
							</label>
							<label><span>产品条码：</span>
								<input type="text" id="barCode" class="isDisabled">
							</label>
						<p>
							<label><span>产品属性：</span>
								<select id="attr" class="isDisabled">
									<option value="1">服务</option>
									<option value="2">产品</option>
									<option value="3">礼品</option>
									<option value="4">车型</option>
								</select></label>
							<label><span>计量单位：</span>
								<select id="unit" class="isDisabled">
									<option value="1">个</option>
									<option value="2">件</option>
									<option value="3">套</option>
									<option value="4">包</option>
									<option value="5">盒</option>
									<option value="6">瓶</option>
									<option value="7">千克</option>
								</select></label>
						</p>
						<p>
							<label><span>产品大类：</span>
								<input type="text" class="isDisabled" onclick="showGoodsType('window1',1)"  id="actLargeType">
							</label>
							<label><span>产品中类：</span>
								<input type="text" class="isDisabled" onclick="showGoodsType('window1',2)"  id="actSmallType" >
							</label>
						</p>
						<p>
							<label><span>产品小类：</span>
								<input type="text" class="isDisabled" onclick="showGoodsType('window1',3)"  id="actMiddleType">
							</label>
							<label><span>产品产地：</span>
								<input type="text"  id="origin" >
							</label>
						</p>
						<p>
							<label><span>产品启用日期：</span>
								<input type="text" class="isDisabled doubledate" id="enableTime"  readonly="readonly">
							</label><label><span>产品截止日期：</span>
								<input id="disableTime" type="text" class="isDisabled doubledate"  readonly="readonly">
							</label>
						</p>
						<p>
							<label><span>状态：</span>
								<select id="status" class="isDisabled">
									<option value="0">未启用</option>
									<option value="1">启用</option>
									<option value="-1">禁止使用</option>
								</select></label>
							<label><span>价格区间：</span>
								<input class="isDisabled" type="text" id="priceStr">
							</label>
						</p>
						<p>
							<label><span>原价：</span>
								<input class="isDisabled" type="text" id="costPrice">
							</label>
							<label><span>零售价：</span>
								<input class="isDisabled" type="text" id="SalePrice">
							</label>
						</p>
						<p>
							<label><span>积分：</span>
								<input class="isDisabled" type="text" id="saleIntegral">
							</label>
						</p>
						<p>
							<label><span>保养周期：</span>
								<input class="isDisabled" style="width: 35px" type="text" id="validYear" value="0">
								年</textarea>
								<input class="isDisabled" style="width: 35px" type="text" value="0" id="validMonth">
								月</textarea>
								<input class="isDisabled" style="width: 35px" value="0" type="text" id="validDay">
								日</label>
							<label><span>施工时间：</span>
								<input class="isDisabled" value="0" type="text" id="workingTime" style="width: 50px;" >
								小时</label>
						</p>
						<p>
							<label> <span>产品描述：</span>
								<input id="indexUrl" type="text" style="width:300px;" readonly="">
							</label>
							<input id="editIndex_btn" class="btn" type="button" value="编辑">
						</p>
						<p>
							<label><span>备注：</span>&nbsp; 								<textarea class="isDisabled" id="memo"></textarea></label>
							<label><span>是否微信相关：</span>
								<select id="isWx" class="isDisabled">
									<option value="1">相关</option>
									<option value="0">不相关</option>
								</select></label>
						</p>
						<div class="BottomBtn">
							<input id="save_btn" type="button" value="保存信息" onclick="toSave()">
						</div>
					</form>
				</div>
			</div>
			<div class="fc"></div>

		</div>
		<!-- InstanceEndEditable -->
		<script type="text/javascript" src="../js/header.js"></script>
		<script type="text/javascript" src="../js/left.js"></script>
		<script type="text/javascript" src="../js/footer.js"></script>
		<script type="text/javascript">
			clearThis("absoluteTxt");
			showTab(2, 3);
		</script>

		<div id="shopShow" class="hideDiv">
			<div style="float:right;margin-bottom:5px;width:20px;height:20px;line-height:20px;text-align:center;background-color:#eee;margin-bottom:5px;border:1px solid #ccc;" >
				<span style="cursor: pointer;font-size: 14px;" onclick="closeShopShow();" >X</span>
			</div>
			<!--     <div class="bottom_search"><div class="serWrapper"><input type="text" id="searchName" class="txt"><strong class="refresh" onclick="$('#searchName').val('')">清空</strong></div><input class="common_btn" type="button" style="width:auto;margin-left:5px;" value="查询" onclick="search2()"></div>
			-->
			<table   id="shopList" cellpadding="4" cellspacing="0" border="1" width="100%">
				<thead>
					<tr>
						<th>供应商ID</th>
						<th>供应商名称</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody></tbody>
			</table>
			<div id="shopPager" class="shopPager"></div>
		</div>
	</body>
	<!-- InstanceEnd -->
</html>
